<template>
 <el-dialog title="保存" :close-on-click-modal="false"  :visible.sync="show" class="dialog_del" :before-close="cancle">
    <p>确认要修改该图片名称吗？</p>
    <span slot="footer" class="dialog-footer">
      <el-button type="search" @click="submitForm">确认</el-button>
      <el-button @click="cancle">取消</el-button>
    </span>
  </el-dialog>
 
</template>

<script>
import {  galleryEdit } from '@/api/gallery/gallery.js'
export default {
  props: {
    show: Boolean,
    closeDialog:Function,
    idList: Array
  },
  methods: {
    cancle() {
      this.$emit('closeDialog')
    },
    submitForm(){
      this.saveForm()
    },
    saveForm(){
      let params ={
        id: this.$parent.curImage.id,
        filename: this.$parent.curImage.filename
      }
      galleryEdit(params).then(res => {
        if(res.state == 1){
          this.cancle()
          this.$message.success('保存成功')
        }
      })


    }
  }
}
</script>

<style>

</style>